home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / s_to_z / vpe_130 / delphi / vpengine.pas < prev   
Pascal/Delphi Source File  |  1996-09-15  |  18KB  |  518 lines

  1. unit VPENGINE;
  2.  
  3. interface
  4.  
  5. Uses WinTypes, WinProcs
  6. {$IFDEF VER80}
  7.        ,Messages;     {Units for Delphi}
  8. {$ELSE}
  9.      ;
  10. {$ENDIF}
  11.  
  12. {/// }
  13. {/// VPECOMON.H }
  14. {/// ========== }
  15. {/// }
  16. {/// Common definitions for the "Virtual Print Engine" }
  17. {/// }
  18. {/// 01/95 by IDEAL Software, T. Radde }
  19. {/// }
  20.  
  21. {/// VpeOpenDoc() Flag Parameters: }
  22. {/// ============================= }
  23. Const VPE_GRID_INBACKGROUND = 1; {// Grid in Background}
  24.       VPE_GRID_INFOREGROUND = 2; {// Grid in Foreground}
  25.       VPE_GRID_TOOLBARBUTTON = 4; {// Grid Toolbar-Button visible}
  26.       VPE_GRID_VISIBLE = 8; {// Actually Grid visible}
  27.  
  28.       VPE_NO_RULER = 16; {// Ruler NOT visible}
  29.       VPE_NO_TOOLBAR = 32; {// Toolbar NOT visible}
  30.       VPE_NO_USER_CLOSE = 64; {// User can't close VPE -}
  31.                               {/// Stop-Button INVISIBLE and Sys-Menu }
  32.                               {/// disabled (if not embedded) }
  33.                               {/// VpeCloseDoc() works! }
  34.       VPE_NO_USER_MOVE = 128; {// User can't leaf through the document}
  35.                               {/// in future: then no Page-Seg in Statusbar }
  36.       VPE_NO_MOUSE_SCALE = 256; {// User can't scale with the MOUSE (VpeSetScale() works!)}
  37.       VPE_NO_USER_SCALE = (512 or VPE_NO_MOUSE_SCALE); {// User can't scale (VpeSetScale() works!)}
  38.                               {/// in future: then no Scale-Seg in Statusbar }
  39.  
  40.       VPE_NO_STATBAR = 1024; {// Statusbar invisible}
  41.  
  42.       VPE_NO_PRINTBUTTON = 2048; {// Print-Button invisible}
  43.                                  {/// VpePrintDoc() works }
  44.  
  45.       VPE_EMBEDDED = 4096; {// Document Window is embedded within}
  46.                            {/// a window of the calling application }
  47.       VPE_LANDSCAPE = 8192; {// Document will be printed in Landscape-Format}
  48.       VPE_MEMORY_SWAP = 16384; {// Each page is swapped to a temporary file, so that}
  49.                                {/// only one page is held in memory (NOT implemented yet!) }
  50.       VPE_NO_HELPBTN = 32768; {// Help-Button invisible}
  51.       VPE_ROUTE_HELP = 65536; {// if Help-Button visible, pressing this or pushing the F1-key}
  52.                               {/// will cause the message VPE_HELP to be send to the owner-window, }
  53.                               {/// no matter if the VPE-window is embedded or not }
  54.       VPE_NO_INFOBTN = 131072; {// Info-Button invisible}
  55.  
  56.       VPE_GRID_POSSIBLE = (VPE_GRID_INFOREGROUND or VPE_GRID_TOOLBARBUTTON);
  57.       VPE_GRID_ON = (VPE_GRID_INFOREGROUND or VPE_GRID_TOOLBARBUTTON or VPE_GRID_VISIBLE);
  58.       VPE_GRID_BKGON = (VPE_GRID_INBACKGROUND or VPE_GRID_TOOLBARBUTTON or VPE_GRID_VISIBLE);
  59.       VPE_GRID_OFF = 0;
  60.  
  61. {/// VpePreviewDoc() Flag Parameters: }
  62. {/// =============================== }
  63.       VPE_SHOW_NORMAL = 1;
  64.       VPE_SHOW_MAXIMIZED = 2;
  65.       VPE_SHOW_HIDE = 3;
  66.  
  67. {/// Text-Formatting Attributes: }
  68. {/// =========================== }
  69.       ALIGN_LEFT = 0;
  70.       ALIGN_RIGHT = 1;
  71.       ALIGN_CENTER = 2;
  72.       ALIGN_JUSTIFIED = 3;
  73.       ALIGN_PRINT = 4;
  74.  
  75. {/// Frame Attributes: }
  76. {/// ================= }
  77.       FRAME_INSIDE = 0;
  78.       FRAME_OUTSIDE = 1;
  79.       FRAME_ONCENTER = 2;
  80.  
  81. {/// Picture Attributes: }
  82. {/// =================== }
  83.       VPE_PIC_MERGE = 1; {// merge background with bitmap (SRCAND instead of SRCCOPY)}
  84.       VPE_PIC_KEEPIMAGE = 2; {// The KEEP-Flags are only relevant when working with a preview.}
  85. {/// An image is the (uncompressed and sometimes huge) data in the file }
  86. {/// that is read into memory. A DIB is an image rendered to the device }
  87. {/// and another (sometimes huge) datablock. }
  88. {/// VPE does the following: }
  89. {/// On VpePicture() the whole image is read into memory and the the image-dimensions }
  90. {/// are calculated. Afterwards the image is immediately removed from memory. }
  91. {/// When the preview opens, and if the picture has to be drawn (LOOP), the image }
  92. {/// is read again into memory and then the DIB is rendered. }
  93. {/// Afterwards the image-data is immediately removed from memory, since only the }
  94. {/// DIB is needed to be displayed. }
  95. {/// The DIB is held in memory until the user moves to another page. }
  96. {/// When printing with the open preview, the DIB is removed, the image-data }
  97. {/// is read in and a new DIB is rendered to the capabilities of the new output device. }
  98. {/// After the DIB is printed, it is immediately removed from memory. }
  99. {/// The things then continue at "LOOP". }
  100. {/// This is the standard behaviour of VPE and a balance between execution speed }
  101. {/// and memory usage. }
  102. {/// So with the flag VPE_PIC_KEEPIMAGE the turn-around between displaying and }
  103. {/// printing will speed up. }
  104. {/// It is also useful, when having only one page (or multiple pages with small }
  105. {/// Bitmaps) in an open preview, since VPE reads the image-data twice }
  106. {/// (for getting the dimensions and then for displaying). }
  107.       VPE_PIC_DISCARD_DIB_DRAW = 4; {// VPE holds in a preview all DIB's in memory until the user moves to}
  108. {/// another page. Using this flag will discard the DIB immediately after drawing }
  109. {/// from memory }
  110.       VPE_PIC_KEEP_DIB_PAGE = 8; {// VPE discards in a preview all DIB's from memory when the user moves}
  111. {/// to another page. Using this flag will stop this mechanism. Also it overrides }
  112. {/// the VPE_PIC_DISCARD_DIB_DRAW flag. }
  113.  
  114.  
  115.  
  116.  
  117. {/// ======================================================================== }
  118. {/// Notification Messages: }
  119. {/// ======================================================================== }
  120.       VPE_DESTROYWINDOW = WM_USER + 2306;
  121.       VPE_PRINT = WM_USER + 2307;
  122.       VPE_PRINTCANCEL = WM_USER + 2308;
  123.       VPE_HELP = WM_USER + 2309;
  124.  
  125. {/// ======================================================================== }
  126. {/// Barcode Types: }
  127. {/// ======================================================================== }
  128.       BCT_EAN13 = 1;
  129.       BCT_EAN8 = 2;
  130.       BCT_UPCA = 3;
  131.       BCT_CODABAR = 5;
  132.       BCT_CODE39 = 6;
  133.       BCT_2OF5 = 7;
  134.       BCT_INTERLEAVED2OF5 = 8;
  135.       BCT_UPCE = 9;
  136.       BCT_EAN13_2 = 10;
  137.       BCT_EAN13_5 = 11;
  138.       BCT_EAN8_2 = 12;
  139.       BCT_EAN8_5 = 13;
  140.       BCT_UPCA_2 = 14;
  141.       BCT_UPCA_5 = 15;
  142.       BCT_UPCE_2 = 16;
  143.       BCT_UPCE_5 = 17;
  144.       BCT_EAN128A = 18;
  145.       BCT_EAN128B = 19;
  146.       BCT_EAN128C = 20;
  147.       BCT_CODE93 = 21;
  148.       BCT_POSTNET = 22;
  149.  
  150. {/// ======================================================================== }
  151. {/// Positioning Codes: }
  152. {/// ======================================================================== }
  153.       VFREE = -1;
  154.       VLEFT = -2;
  155.       VRIGHT = -3;
  156.       VLEFTMARGIN = -4;
  157.       VRIGHTMARGIN = -5;
  158.       VTOP = -6;
  159.       VBOTTOM = -7;
  160.       VTOPMARGIN = -8;
  161.       VBOTTOMMARGIN = -9;
  162.  
  163. {/// }
  164. {/// VPIFACE.H }
  165. {/// ========= }
  166. {/// }
  167. {/// The DLL-Interface for the "Virtual Print Engine". }
  168. {/// }
  169. {/// To be used by the calling applications. }
  170. {/// }
  171. {/// external Macro-Definitions: }
  172. {/// WINDOWS_DLL generates Windows DLL-Code, else Windows static library }
  173. {/// }
  174. {/// 11/94 by IDEAL Software, T. Radde }
  175. {/// }
  176.  
  177. function VpeGetVersion: Integer;
  178.  
  179. function VpeOpenDoc(hWndParent: HWND;
  180.                     title: PChar;
  181.                     page_width: Integer;
  182.                     page_height: Integer;
  183.                     flags: LongInt): LongInt;
  184.  
  185. function VpeCloseDoc(hDoc: LongInt): Integer; 
  186.  
  187. function VpeWindowHandle(hDoc: LongInt): HWND;
  188.  
  189. procedure VpeSetDefaultOutputRect(hDoc: LongInt; 
  190.                                   r: PRECT); 
  191.  
  192. procedure VpeSetOutputRect(hDoc: LongInt;
  193.                            r: PRECT); 
  194.  
  195. procedure VpeGetOutputRect(hDoc: LongInt; 
  196.                            r: PRECT); 
  197.  
  198. procedure VpeSetPosRect(hDoc: LongInt; 
  199.                         r: PRECT); 
  200.  
  201. procedure VpeGetPosRect(hDoc: LongInt; 
  202.                         r: PRECT); 
  203.  
  204. procedure VpeSet(hDoc: LongInt; 
  205.                  what: Integer; 
  206.                  value: Integer); 
  207.  
  208. function VpeGet(hDoc: LongInt; 
  209.                 what: Integer): Integer; 
  210.  
  211. procedure VpeStorePos(hDoc: LongInt); 
  212.  
  213. procedure VpeRestorePos(hDoc: LongInt);
  214.  
  215. procedure V